package com.example.mybatis.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * @author xiongwei
 * @date 2020-11-8
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class City {

    private Integer id;
    private String name;
    private String countryCode;
    private String district;
    private Integer population;

    private Country country;
    public String getCountryCode(){
        if (null == country){
            return null;
        }
        return country.getCode();
    }


}
